import Vue from "vue";
import VueRouter from "vue-router";
import Index from './pages/Index.vue';
import Home from './pages/Home.vue';




Vue.use(VueRouter);

export default new VueRouter({

    routes:[
        {
            path:'/',
            name:'Index',
            component: Index,
            redirect:'/home',
            children:[
                {
                    path: 'home',
                    name: 'Home',
                    component: Home
                },
                {
                    path: 'setting',
                    name: 'Setting',
                    component: () => import('./pages/Setting.vue')
                },
                {
                    path: 'chapter',
                    name: 'Chapter',
                    component: () => import('./pages/Chapter.vue')
                },
                {
                    path: 'library',
                    name: 'Library',
                    component: () => import('./pages/Library.vue')
                },
                {
                    path: 'user',
                    name: 'User',
                    component: () => import('./pages/User.vue')
                },
                {
                    path: 'book',
                    name: 'Book',
                    component: () => import('./pages/Book.vue')
                },
                {
                    path: 'post',
                    name: 'Post',
                    component: () => import('./pages/Post.vue')
                },
                {
                    path: 'bookdetail',
                    name: 'BookDetail',
                    component: () => import('./pages/BookDetail.vue')
                },
                {
                    path: 'addq',
                    name: 'AddQ',
                    component: () => import('./pages/AddQ.vue')
                },
            ]

        }
        
        
    ],
});